package com.lineage.config;

import com.lineage.server.utils.PerformanceTimer;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public final class ConfigDragonKnightSkill {
  private static final Log _log = LogFactory.getLog(ConfigDragonKnightSkill.class);
  
  public static int FOE_SLAYER_RND;
  
  public static int FOE_SLAYER_SEC;
  
  public static int FOE_SLAYER_DMG;
  
  public static int VULNERABILITY_OTHER;
  
  public static int VULNERABILITY_ROM;
  
  public static int VULNERABILITY_1;
  
  public static int VULNERABILITY_2;
  
  public static int VULNERABILITY_3;
  
  public static int SLAY_BREAK_1;
  
  public static int SLAY_BREAK_2;
  
  public static int SLAY_BREAK_3;
  
  public static boolean SLAY_BREAK_NOT_TELEPORT;
  
  public static int MORTAL_BODY_ROM;
  
  public static int MORTAL_BODY_DMG;
  
  private static final String CONFIG_FILE = "./config/龙骑士_技能设定表.properties";
  
  public static void load() throws ConfigErrorException {
    PerformanceTimer timer = new PerformanceTimer();
    Properties set = new Properties();
    try {
      InputStream is = new FileInputStream(new File("./config/龙骑士_技能设定表.properties"));
      set.load(is);
      is.close();
      MORTAL_BODY_ROM = Integer.parseInt(set.getProperty("MORTAL_BODY_ROM", "23"));
      MORTAL_BODY_DMG = Integer.parseInt(set.getProperty("MORTAL_BODY_DMG", "30"));
      SLAY_BREAK_NOT_TELEPORT = Boolean.parseBoolean(set.getProperty("SLAY_BREAK_NOT_TELEPORT", "true"));
      FOE_SLAYER_RND = Integer.parseInt(set.getProperty("FOE_SLAYER_RND", "15"));
      FOE_SLAYER_SEC = Integer.parseInt(set.getProperty("FOE_SLAYER_SEC", "30"));
      FOE_SLAYER_DMG = Integer.parseInt(set.getProperty("FOE_SLAYER_DMG", "10"));
      VULNERABILITY_OTHER = Integer.parseInt(set.getProperty("VULNERABILITY_OTHER", "10"));
      VULNERABILITY_ROM = Integer.parseInt(set.getProperty("VULNERABILITY_ROM", "15"));
      VULNERABILITY_1 = Integer.parseInt(set.getProperty("VULNERABILITY_1", "5"));
      VULNERABILITY_2 = Integer.parseInt(set.getProperty("VULNERABILITY_2", "10"));
      VULNERABILITY_3 = Integer.parseInt(set.getProperty("VULNERABILITY_3", "15"));
      SLAY_BREAK_1 = Integer.parseInt(set.getProperty("SLAY_BREAK_1", "5"));
      SLAY_BREAK_2 = Integer.parseInt(set.getProperty("SLAY_BREAK_2", "10"));
      SLAY_BREAK_3 = Integer.parseInt(set.getProperty("SLAY_BREAK_3", "15"));
    } catch (Exception e) {
      throw new ConfigErrorException("设置档案遗失: ./config/龙骑士_技能设定表.properties");
    } finally {
      set.clear();
      _log.info("Config/龙骑士_技能设定表读取完成 (" + timer.get() + "ms)");
    } 
  }
}
